Skip to content

feat: ETU-70853 Make Cloud SQL Proxy term_timeout configurable#245

Merged
bvestli merged 1 commit intomainfrom
ETU-70853-configurable-cloud-sql-proxy-term-timeout
Apr 22, 2026
Merged

feat: ETU-70853 Make Cloud SQL Proxy term_timeout configurable#245
bvestli merged 1 commit intomainfrom
ETU-70853-configurable-cloud-sql-proxy-term-timeout

Conversation

@thomass-entur
Copy link
Copy Markdown
Collaborator

What and why

The Cloud SQL Proxy sidecar has -term_timeout hardcoded to 30s. This controls how long the proxy waits for existing connections to drain after receiving SIGTERM before force-closing them.

For services with long-lived jobs (e.g. batch processing that writes to the database), the proxy tears down database connections after 30s even when the pod's terminationGracePeriodSeconds is set much higher. This causes in-flight jobs to lose their DB connection mid-run during rolling deployments.

Changes

  • _helpers.tpl: replace hardcoded -term_timeout=30s with {{ .postgres.termTimeout | default "30s" }} — backwards compatible, default unchanged
  • values.yaml: add postgres.termTimeout with doc comment
  • Chart.yaml: bump to 1.21.2

Testing

Consumers can now set:

postgres:
  termTimeout: 3600s

to align the proxy's connection drain timeout with their pod's terminationGracePeriodSeconds.

The -term_timeout flag was hardcoded to 30s. For services that run
long-lived jobs (e.g. Netex batch processing), the proxy closes database
connections after 30s even though the pod's terminationGracePeriodSeconds
allows much longer. This causes in-flight jobs to lose their DB connection
mid-run during rolling deployments.

Adding postgres.termTimeout allows each chart consumer to set a timeout
appropriate for their workload, while keeping 30s as the default.
@thomass-entur thomass-entur requested a review from a team as a code owner April 22, 2026 08:21
@thomass-entur thomass-entur changed the title ETU-70853 Make Cloud SQL Proxy term_timeout configurable feat: ETU-70853 Make Cloud SQL Proxy term_timeout configurable Apr 22, 2026
Copy link
Copy Markdown
Contributor

@bvestli bvestli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good update. Thanks!

@bvestli bvestli merged commit c3bd117 into main Apr 22, 2026
35 of 36 checks passed
@bvestli bvestli deleted the ETU-70853-configurable-cloud-sql-proxy-term-timeout branch April 22, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants